package suncertify.db;

import java.io.Serializable;

/**
 * Represents an actual Room object with the following variables
 * <code>name, location, size, smoking, rate, date, owner</code>.
 * @author Paul Wilhelm
 *
 */
public class Room implements Serializable{
	

	private static final long serialVersionUID = 1981;		//A UID to be used during deserialization
	private String name;				//The name of the Room
	private String location;			//The location of the Room
	private String size;				//The capacity of the room
	private String smoking;				//Smoking or non-smoking ('Y' or 'N')
	private String rate;				//The price of the room
	private String date;				//The date the room is available
	private String owner;				//The customer currently holding the record for the Room
	
	/**
	 * Constructor. Creates a new <code>Room<code> object.
	 * @param name - The name of the room
	 * @param location - The location of the room
	 * @param size - The size of the room
	 * @param smoking - 'Y' or 'N'
	 * @param rate - The rate of the room
	 * @param date - The date when the room is available to stay in
	 * @param owner - The id of the person who has booked the room
	 */
	public Room(String name, String location, String size, String smoking, String rate, String date, String owner){
		this.name = name;
		this.location = location;
		this.size = size;
		this.smoking = smoking;
		this.rate = rate;
		this.date = date;
		this.owner = owner;
	}
	
	/**
	 * Gets the each element of the <code>Room</code> object.
	 * @return A String[] containing each element of the Room object in the order declared above
	 */
	public String[] getAllInfo(){
		String[] roomInfo = new String[7];		//Creates the String[] then assigns all the values.
		roomInfo[0] = getName();
		roomInfo[1] = getLocation();
		roomInfo[2] = getSize();
		roomInfo[3] = getSmoking();
		roomInfo[4] = getRate();
		roomInfo[5] = getDate();
		roomInfo[6] = getOwner();
		return roomInfo;
	}
	
	/**
	 * Gets the name of the <code>Room</code>.
	 * @return a String representing the name of the room
	 */
	public String getName() {
		return name;
	}
	
	/**
	 * Sets the name of the <code>Room</code> to the parameter specified.
	 * @param name - The name of the room.
	 */
	public void setName(String name) {
		this.name = name;
	}
	
	/**
	 * Gets the location of the <code>Room</code>.
	 * @return a String representing the location of the room
	 */
	public String getLocation() {
		return location;
	}
	
	/**
	 * Sets the location of the <code>Room</code> to the parameter specified.
	 * @param location - The location of the room.
	 */
	public void setLocation(String location) {
		this.location = location;
	}
	
	/**
	 * Gets the size of the <code>Room</code>.
	 * @return a String representing the size of the room
	 */
	public String getSize() {
		return size;
	}
	
	/**
	 * Sets the size of the <code>Room</code> to the parameter specified.
	 * @param size - The size of the room.
	 */
	public void setSize(String size) {
		this.size = size;
	}
	
	/**
	 * Gets the smoking status of the <code>Room</code>.
	 * @return a String representing the smoking status of the room
	 */
	public String getSmoking() {
		return smoking;
	}
	
	/**
	 * Sets the smoking status of the <code>Room</code> to the parameter specified.
	 * @param smoking - The smoking status of the room.
	 */
	public void setSmoking(String smoking) {
		this.smoking = smoking;
	}
	
	/**
	 * Gets the rate of the <code>Room</code>.
	 * @return a String representing the rate of the room
	 */
	public String getRate() {
		return rate;
	}
	
	/**
	 * Sets the rate of the <code>Room</code> to the parameter specified.
	 * @param rate - The rate of the room.
	 */
	public void setRate(String rate) {
		this.rate = rate;
	}
	
	/**
	 * Gets the date of the <code>Room</code>.
	 * @return a String representing the date of the room
	 */
	public String getDate() {
		return date;
	}
	
	/**
	 * Sets the date of the <code>Room</code> to the parameter specified.
	 * @param date - The date of the room.
	 */
	public void setDate(String date) {
		this.date = date;
	}
	
	/**
	 * Gets the owner of the <code>Room</code>.
	 * @return a String representing the owner of the room
	 */
	public String getOwner() {
		return owner;
	}
	
	/**
	 * Sets the owner of the <code>Room</code> to the parameter specified.
	 * @param owner - The owner of the room.
	 */
	public void setOwner(String owner) {
		this.owner = owner;
	}
}
